﻿Imports System.Reflection

''' <summary>
''' システム値属性
''' </summary>
''' <remarks>
''' 作業者などの内部情報処理用属性
''' </remarks>
<AttributeUsage(AttributeTargets.Class Or AttributeTargets.Property, Allowmultiple:=False)>
Public NotInheritable Class SystemValueAttribute
    Inherits SpecialValueAttribute

    ''' <summary>
    ''' 保存値が読み込まれるときに発生するイベント
    ''' </summary>
    ''' <remarks></remarks>
    Public Shared Event OnSaveValueReading As EventHandler(Of SaveValueReadingEventArgs)

    ''' <summary>
    ''' 値読み込みイベントを発生させます
    ''' </summary>
    ''' <param name="instance"></param>
    ''' <param name="prop"></param>
    ''' <param name="oldValue"></param>
    ''' <remarks></remarks>
    Public Overrides Sub RaiseSaveValueReadingEvent(instance As Object, prop As LiteralProperty, oldValue As Object)
        Dim e As New SaveValueReadingEventArgs With {.Instance = instance, .LiteralProperty = prop, .OldValue = oldValue}
        RaiseEvent OnSaveValueReading(Me, e)
    End Sub
End Class

